import request from '@/utils/http'

// 获取轮播图列表
export const getBannerList = () => {
  return request({
    url: '/banner'
  })
}

// 新增轮播图
export const addBanner = (data) => {
  return request({
    url: '/banner/add',
    method: 'post',
    data
  })
}

// 修改轮播图
export const updateBanner = (data) => {
  return request({
    url: '/banner/update',
    method: 'PUT',
    data
  })
}

// 删除轮播图
export const deleteBanner = (id) => {
  return request({
    url: `/banner/${id}`,
    method: 'DELETE'
  })
}

// 查询标签列表
export const getTagList = () => {
  return request({
    url: '/tags'
  })
}
// 新增标签
export const addTag = (data) => {
  return request({
    url: '/tags',
    method: 'post',
    data
  })
}
// 修改标签
export const updateTag = (data) => {
  return request({
    url: '/tags',
    method: 'PUT',
    data
  })
}
// 删除标签
export const deleteTag = (id) => {
  return request({
    url: `/tags/${id}`,
    method: 'DELETE'
  })
}
